﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Website/Views/Shared/Website.Master"
    Inherits="System.Web.Mvc.ViewPage<BrandViewModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <div class="brand_t">
        <div class="brand_t_r">
        </div>
    </div>
    <div class="brand_list">
        <h2>
            <img alt="推荐品牌" src="<%=Url.Content("~/WebResources/Images/RecommBrand.gif") %>" /></h2>
        <% Html.RenderPartial("BrandList", Model.BrandList); %>
    </div>
    <div class="brand_b">
        <div class="brand_b_r">
        </div>
        <div class="brand_b_l">
        </div>
    </div>
    <div class="class_brand">
        <ul>
            <%foreach (ClassifyEntity ce in Model.ClassifyList) { %>
            <li id="<%=ce.ClassifyId %>">
                <%=ce.Title %></li>
            <%} %>
        </ul>
    </div>
    <div class="brand_t">
        <div class="brand_t_l">
        </div>
        <div class="brand_t_r">
        </div>
    </div>
    <div class="brand_list" id="divbrandlist">
        <% Html.RenderPartial("Loading"); %>
    </div>
    <div class="brand_b">
        <div class="brand_b_r">
        </div>
        <div class="brand_b_l">
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cssLink" runat="server">
    <link rel="Stylesheet" type="text/css" href="<%= Url.Content("~/Css/Website/Brand.css") %>" />
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="jsContent" runat="server">

    <script type="text/javascript">

        $(function() {
            var loadHtml = $("#divbrandlist").html();
            var url = '<%=Url.Action("BrandList", "Brand", new { id = "-id-" }) %>';
            $(".class_brand li").click(function() {
                $(".class_brand li").removeClass();
                $("#divbrandlist").html(loadHtml);
                $(this).addClass("colorRed");
                $.post(url.replace(/-id-/ig, $(this).attr("id")), null, function(html) {
                    $("#divbrandlist").html(html);
                });
            });
            $(".class_brand li").eq(0).click();
        });        
    </script>

</asp:Content>
